﻿<!--#include file="conn.asp"-->
<!--#include virtual="/inc/md5.inc"-->
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>采集管理界面</title>
<style type="text/css">
<!--
body {
	background-image: url(images/bg.gif);
	margin: 0px;
	background-repeat: repeat-x;
}
table,td{
font-family:"宋体";
font-size:12px;
}
.inputtext{
border-left:1px solid balck;
border-right:1px solid balck;
border-top:1px solid balck;
border-bottom:1px solid balck;
}
.loginbg {
font-size: 12px;
width: 59px;
height: 26px;
background-image: url(images/login_bg.gif);
border: none;
padding-top: 3px;
color:white;}
-->
</style>
</head>
<body>
<%
dim action
action=trim(request("action"))
select case action
       case "chkadmin"
          call check()
       case "out"
          call out()
       case else
          call main()
end select
sub main()
%>
<script language="javascript">
function checklogin()
{
  if(document.login.username.value=='')
     {alert('请输入用户名');
      document.login.username.focus();
      return false
    }
  if (document.login.password.value=='')
   {alert('请输入密码');
    document.login.password.focus();
    return false
   }
}
</script>
<table width="100%" height="98" border="0" cellspacing="0" cellpadding="0">
<form action="login.asp?action=chkadmin" name="login" method="post" onSubmit="return checklogin();">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="50%" align="center" height="34" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="images/admin_02.gif" width="291" height="34"></td>
  </tr>
</table>
<table width="100%" height="30" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="50%" height="261" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="457" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3"><img src="images/admin_05.gif" width="457" height="40" border="0" usemap="#Map"></td>
      </tr>
      <tr>
        <td width="142" rowspan="3"><img src="images/admin_07.gif" width="142" height="221"></td>
        <td width="240" valign="top"><img src="images/admin_08.gif" width="240" height="42"></td>
        <td width="75" rowspan="3"><img src="images/admin_09.gif" width="75" height="221"></td>
      </tr>
      <tr>
        <td height="107" valign="top" background="images/admin_10.gif">
		<table width="75%"  align="center" height="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="24%" height="30">用&nbsp;&nbsp;户:</td>
                    <td width="76%" height="30"><input type="text" name="username" size="15" class="inputtext"></td>
                  </tr>
                  <tr>
                    <td height="25">密&nbsp;&nbsp;码:</td>
                    <td height="25"><input type="password" name="password" size="15" class="inputtext">
                  <tr>
                    <td height="25" colspan="2"><p align="center"><input type="submit" value="登 陆" class="loginbg">&nbsp;&nbsp;<input type="reset" value="取 消" class="loginbg"></td>
                    </tr>
                </table></td>
      </tr>
      <tr>
        <td valign="bottom"><img src="images/admin_11.gif" width="240" height="52"></td>
      </tr>
    </table></td>
  </tr></form>
</table>
<%
end sub
sub check()
dim username,password,code,getcode
username=strlogin(request.form("username"))
password=strlogin(request.form("password"))


if username="" then
response.write"<script>alert('用户名不能为空！');location.href='login.asp';</script>"
response.end
end if

if username<>"" and instr(username,chr(39))>0 or instr(username,chr(34))>0 then
response.write"<script>alert('用户名非法！');location.href='login.asp';</script>"
response.end
end if

if password="" then
response.write"<script>alert('密码不能为空！');location.href='login.asp';</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from qingtian_admin where name='"&username&"' and pass='"&md5(password)&"'"
rs.open sql,conn,0,1
if rs.eof then
response.write"<script>alert('没有该用户！');location.href='login.asp';</script>"
response.end
rs.close
set rs=nothing
else   
		Response.cookies("xywapbook")("xywapbook_username")=strlogin(request.form("username"))
		Response.cookies("xywapbook")("xywapbook_password")=strlogin(request.form("password"))
   response.redirect"index.asp"
  response.end
end if
rs.close
set rs=nothing
end sub
sub out()
		Response.cookies("xywapbook")("xywapbook_username")=""
		Response.cookies("xywapbook")("xywapbook_password")=""
response.redirect"login.asp"
response.end
end sub
%>
<map name="Map"><area shape="rect" coords="348,1,436,39" href="">
</map></body>
</html>
